package com.demo.juc.state;

import java.util.concurrent.TimeUnit;

/**
 * 线程逻辑：一致循环sleep
 *
 * "WaitingTimeThread" #14 prio=5 os_prio=0 tid=0x000000001f0ff800 nid=0xbbc waiting on condition [0x000000002006f000]
 *    java.lang.Thread.State: TIMED_WAITING (sleeping)
 *
 */
public class WaitingTimeThread implements Runnable{
    @Override
    public void run() {
        while (true) {
            try {
                TimeUnit.SECONDS.sleep(2);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
